<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/5/21
 * Time: 15:21
 */

/*使用的是默认的auth 有登入后返回到哪里*/

Route::group(['domain' => config('domain.admin.web')], function () {
//'prefix' => 'admin'
    Route::group(['namespace' => 'Admin',  'middleware' => ['auth', 'adminlogin', 'adminmeun']], function () {

        Route::get('/', 'IndexCtrl@index')->name('admin.index');

        Route::get('/roles.html', 'RolesCtrl@index')->name('admin.roles');

        Route::get('/roles_create.html', 'RolesCtrl@create')->name('admin.roles.create');
        Route::post('/roles_create.html', 'RolesCtrl@store')->name('admin.roles.create');

        Route::get('/roles_edit/{id}.html', 'RolesCtrl@edit')->name('admin.roles.edit');
        Route::post('/roles_edit/{id}.html', 'RolesCtrl@renovate')->name('admin.roles.edit');

        Route::get('/roles_addpes/{id}.html', 'RolesCtrl@permussion')->name('admin.roles.addPMsion');
        Route::post('/roles_addpes/{id}.html', 'RolesCtrl@setpmsion')->name('admin.roles.addPMsion');

        //admin.roles.addmuen
        Route::get('/roles_addmuen/{id}.html', 'RolesCtrl@addmuen')->name('admin.roles.addmuen');
        Route::post('/roles_addmuen/{id}.html', 'RolesCtrl@setAddMuen')->name('admin.roles.addmuen');


        Route::get('/menu_create.html', 'MenuCtrl@create')->name('admin.menu.create');
        Route::post('/menu_create.html', 'MenuCtrl@store')->name('admin.menu.create');

        Route::get('/menu_edit/{id}.html', 'MenuCtrl@edit')->name('admin.menu.edit');
        Route::post('/menu_edit/{id}.html', 'MenuCtrl@renovate')->name('admin.menu.edit');

        Route::get('user/index.html', 'UserCtrl@index')->name('admin.user.index');
        Route::get('user/roles_{id}.html', 'UserCtrl@roles')->name('admin.user.roles');
        Route::post('user/roles_{id}.html', 'UserCtrl@setroles')->name('admin.user.roles');

        Route::get('user/{id}.html', 'UserCtrl@edit')->name('admin.user.edit');

        //广告
        Route::get('ad', 'AdCtrl@index')->name('admin.ad.index');
        Route::get('ad/create', 'AdCtrl@create')->name('admin.ad.create');
        Route::post('ad/create', 'AdCtrl@store')->name('admin.ad.create');
        Route::get('ad/edit/{id}', 'AdCtrl@edit')->name('admin.ad.edit');
        Route::post('ad/edit/{id}', 'AdCtrl@store')->name('admin.ad.edit');
        Route::get('ad/destroy/{id}', 'AdCtrl@destroy')->name('admin.ad.destroy');
        Route::get('adposition', 'AdCtrl@position')->name('admin.adposition.index');
        Route::get('adposition/create', 'AdCtrl@position_create')->name('admin.adposition.create');
        Route::post('adposition/create', 'AdCtrl@position_store')->name('admin.adposition.create');
        Route::get('adposition/destroy/{id}', 'AdCtrl@position_destroy')->name('admin.adposition.destroy');

        //友情链接
        Route::get('link', 'LinkCtrl@index')->name('admin.link.index');
        Route::get('link/create', 'LinkCtrl@create')->name('admin.link.create');
        Route::post('link/create', 'LinkCtrl@store')->name('admin.link.create');
        Route::get('link/destroy/{id}', 'LinkCtrl@destroy')->name('admin.link.destroy');

        //导航
        Route::get('nav', 'NavCtrl@index')->name('admin.nav.index');
        Route::get('nav/{id}', 'NavCtrl@index')->name('admin.nav.edit');
        Route::get('nav/create', 'NavCtrl@create')->name('admin.nav.create');
        Route::post('nav/create', 'NavCtrl@store')->name('admin.nav.create');
        Route::get('nav/destroy/{id}', 'NavCtrl@destroy')->name('admin.nav.destroy');

    });
});


























